import Vue from 'vue';
import ElementUI from 'element-ui';
import VueRouter from 'vue-router'

import 'element-ui/lib/theme-default/index.css';
import App from './App';
import api from './api';

Vue.use(ElementUI);
Vue.use(VueRouter)

import Vuex from 'vuex'

Vue.use(Vuex)

import vuexI18n from 'vuex-i18n'
import store from './common/store';

Vue.use(vuexI18n.plugin, store)

import VueSocketio from 'vue-socket.io';

Vue.use(VueSocketio, api.globalUrl);

import 'video.js/dist/video-js.css';
import 'vue-video-player/src/custom-theme.css';
//import {ToastPlugin } from 'vuex'
//Vue.use(ToastPlugin)
// 引用路由配置文件
import routes from './common/routes'
// 使用配置文件规则
const router = new VueRouter({
  routes
})
import ga from 'vue-ga'
import ba from 'vue-ba'
if (process.env.NODE_ENV != "development") { //dev.7dtime.com开发统计
  ga(router, 'UA-40324677-6');
  Vue.use(ba, '0ea90a88c8bf02ff94aa301a276ff886')
} else { //7dtime.com 时间清单正式服
  Vue.use(ba, 'eee3e11d38889522643bfe1bb9f343f9') //统计开发数据
}


router.afterEach((to) => {
  ba.trackPageview(to.fullPath)
})
// 跑起来吧
window.app = new Vue({ // eslint-disable-line no-new
  router,
  store,
  el: '#app1',
  render: (h) => h(App)
})
